<me:UIFQI03   x:Class="WPFExcelReport.TFQI03"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                     xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT" 
                    xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM" 
                    xmlns:BW="clr-namespace:WPFExcelReport;assembly=TWBBEW" 
                    xmlns:WB="clr-namespace:WPFExcelReport;assembly=TWBDAT" 
                    xmlns:ER="clr-namespace:WPFExcelReport;assembly=TWBFEHL"
                     xmlns:FK="clr-namespace:WPFExcelReport;assembly=TWBFKOPF"
                    xmlns:DR="clr-namespace:WPFExcelReport;assembly=TDRAUFTR" 
                    xmlns:AB="clr-namespace:WPFExcelReport;assembly=TABPOS" 
                    xmlns:AM="clr-namespace:WPFExcelReport;assembly=TAMSTAMM"  
                    xmlns:VF="clr-namespace:WPFExcelReport;assembly=TVAFARBEN" 
                    xmlns:WH="clr-namespace:WPFExcelReport;assembly=TLAGPL"  
                     xmlns:HR="clr-namespace:WPFExcelReport;assembly=THRSTAMM" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"  
                    xmlns:Stopwatch="clr-namespace:Intex.Controls.Stopwatch;assembly=Intex.Controls"
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                   x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIFQI03.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:KM2YD  x:Key="km2yd"/>
        <ucd:NOTConverter x:Key="not"/>
        <ucd:TextTrimmingConverter x:Key="trim"/>
    </me:UIFQI03.Resources> 
    <TabControl>
        <TabItem Header="{Binding Source={Localization:Translate Word=在验}}" Name="cOnline">
            <Grid IsEnabled="{Binding IsBusy,ElementName=TV,Converter={StaticResource not}}">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="1*"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1.2*"></ColumnDefinition>
                    <ColumnDefinition Width="1*"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Row="0" Grid.Column="0"  Grid.ColumnSpan="2"
                Margin="10,0,0,0" VerticalAlignment="Top">
                    <WrapPanel Margin="0,0,0,0" VerticalAlignment="Top">
                        <WrapPanel  VerticalAlignment="Top">
                            <ex:TXT72 MaxLength="12" Grid.Column="1" FontSize="18"   Name="cWB" Height="40"
                              KeyUp="Query_KeyUp"
                              TabIndex="1" CharacterCasing="Upper"
                              Text="{Binding STKNR,ElementName=TV}" Width="180" />
                            <Button   Click="QueryCommand" Height="40"  Margin="20,0,0,0" Width="Auto"  VerticalAlignment="Center" FontSize="18"   Content="{Binding Source={Localization:Translate Word=坯布卷号}}"/>
                            <WrapPanel Visibility="Collapsed">
                                <TextBlock Margin="5,0,0,0"  FontSize="14" VerticalAlignment="Center"
                                       Text="{Binding Source={Localization:Translate Word=完成检验:}}"/>
                                <TextBlock Text="{Binding WBBINBSTMTR,Converter={StaticResource d1000}}"
                                       Grid.Column="1" FontSize="14"   Width="80" 
                                       />
                                <TextBlock  Margin="10,0,0,0"   FontSize="14" VerticalAlignment="Center"
                                        Text="{Binding Source={Localization:Translate Word=在验:}}"/>
                                <TextBlock Margin="10,0,0,0"   Text="{Binding QTY,ElementName=TV,Converter={StaticResource d1000}}"
                                        FontSize="14"   Width="80"
                                       />
                            </WrapPanel>

                            <Button Margin="5,0,0,0"  Visibility="Collapsed"     FontSize="16" Width="100" Height="40" Content="{Binding Source={Localization:Translate Word=落布长度}}" Click="ChgQtyCommand"/>
                        </WrapPanel>
                        <WrapPanel  VerticalAlignment="Top">
                            <Button   Click="NewCommand" 
                                      Margin="5,0,0,0"  FontSize="16" Width="100" Height="40" VerticalAlignment="Center"  Content="{Binding Source={Localization:Translate Word=开始}}"/>
                            <Label Margin="10,0,0,0" Content="{Binding Source={Localization:Translate Word=坯布长度}}" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" ></Label>
                            <ex:TXT72 IsReadOnly="True" Margin="5,0,0,0"   Text="{Binding WBBISTKLG,Converter={StaticResource d1000}}" LostFocus="STKLG_LostFocus" 
                                       IsAutoClear="True"  FontSize="20"   Width="80" Height="40" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />                           
                            <Button   Click="SaveCommand" 
                                      Margin="5,0,0,0"  FontSize="16" Width="100" Height="40" VerticalAlignment="Center" Content="{Binding Source={Localization:Translate Word=完成大卷}}" Visibility="Collapsed"/>

                            <Button   Click="CutFCommand"
                                      FontSize="16"
                                  Margin="5,0,0,0" Width="100" Height="40" VerticalAlignment="Center" 
                                      Tag="JP"
                                      Content="{Binding Source={Localization:Translate Word=开剪(+)}}" />
                            <Button   Click="CutFCommand"
                                      Tag="NP"
                                      FontSize="16"
                                     Margin="5,0,0,0" Width="100" Height="40" VerticalAlignment="Center" 
                                      Content="{Binding Source={Localization:Translate Word=开剪(X)}}" />
                            <Button    Margin="10,0,0,0"  FontSize="18" Width="100" Click="LBCutCommand" Visibility="Collapsed"
                                     VerticalAlignment="Center"  Content="{Binding Source={Localization:Translate Word=零布}}"/>
                            <Button    Margin="10,0,0,0"  FontSize="18" Width="100" Click="lbStartCommand"
                                     VerticalAlignment="Center"  Content="{Binding Source={Localization:Translate Word=零布开始}}"/>

                            <Button   Margin="10,0,0,0"  FontSize="18" Width="100" Click="lbEndCommand" VerticalAlignment="Center" 
                                     Content="{Binding Source={Localization:Translate Word=零布完成}}"/>
                            <WrapPanel Visibility="Collapsed">
                                <TextBox Text="{Binding WH,ElementName=TV}" Width="100"/>
                                <WH:TSWH KEY="{Binding WH,ElementName=TV}"/>
                            </WrapPanel>
                            <Label 
                                FontSize="24" Margin="10,0,0,0" Width="30" Height="40"  Content="{Binding CPCS,ElementName=TV}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
                            <SD:K9316 KEY="{Binding CPCS,ElementName=TV}"/>
                        </WrapPanel>
                    </WrapPanel>

                </StackPanel>
                <Grid Grid.Row="1" Grid.Column="0"   Grid.ColumnSpan="2" Margin="0,20,0,0">
                    <WrapPanel >
                        <WrapPanel Margin="20,10,5,5" >
                            <Label Margin="0,0,0,0" Content="{Binding Source={Localization:Translate Word=品种: }}" FontSize="16"    />
                            <TextBlock  FontSize="20" Text="{Binding KEY,ElementName=cWS,Converter={StaticResource trim}}"
                                     />
                            <Label Margin="5,0,0,0"  Content="{Binding Source={Localization:Translate Word=色号: }}"  FontSize="16"   />
                            <TextBlock  FontSize="20" Text="{Binding WBBFARBE,Converter={StaticResource gb2312}}" />
                            <Label Margin="5,0,0,0" Content="{Binding Source={Localization:Translate Word=织物名称: }}" FontSize="16"  Visibility="Collapsed"/>
                            <TextBlock FontSize="20"  Text="{Binding DES,ElementName=cWS,Converter={StaticResource gb2312}}" MaxWidth="300" Visibility="Collapsed" />
                        </WrapPanel>
                        <FK:TWB18 Name="cFK"
                              EXAUF="{Binding FRWAUF,ElementName=TV}"
                              IsAuto="True"
                              IsEdit="{Binding IsEdit,ElementName=TV}"
                              IsSaved="{Binding IsSaved,ElementName=TV}"
                              ERVER="{Binding ERVER,ElementName=TV}"/>
                        <Grid Grid.Row="3" Grid.Column="0"  Grid.ColumnSpan="2" Margin="20,10,0,10">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="auto"/>
                                <ColumnDefinition Width="auto"/>
                            </Grid.ColumnDefinitions>
                            <WrapPanel  Grid.Column="1"  >
                                <Stopwatch:StopwatchControl Name="stopwatch" Height="40" CQTY="{Binding CMTR,ElementName=TV}" Width="170"/>
                                <ex:NumericBox Text="{Binding CMTR,ElementName=TV,Converter={StaticResource d1000}}" 
                                Margin="5,0,0,0"
                               DecimalPlaces="1"
                               VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20"
                                 Width="100" Height="40" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"/>
                            </WrapPanel>
                        </Grid>
                    </WrapPanel>
                </Grid>
                <WrapPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,20,0,0" >
                    <me:TFWB08 ORDERNUM="{Binding NSTKNR,ElementName=TV}" 
                                  x:Name="cWB08"
                                  IsJP="{Binding IsJP,ElementName=TV}" 
                                  CPCS="{Binding CPCS,ElementName=TV}"   
                                  IsEdit="{Binding IsEdit,ElementName=TV}" 
                                  IsPrint="{Binding IsPrint,ElementName=TV}"  
                                  RWAUF="{Binding FRWAUF,ElementName=TV}" 
                                  CMTR="{Binding CMTR,ElementName=TV}"  
                                  LOOMID="{Binding LOOMID,ElementName=TV}"   
                                  SHIFT="{Binding SHIFT,ElementName=TV}"  
                                  PRNLB="{Binding PRNLB,ElementName=TV}"   
                                  dwWS="{Binding dwWS,ElementName=cWS}"
                                  TTPOINTS="{Binding TTPOINTS,ElementName=cFERK}" />
                </WrapPanel>
                
                <Grid Margin="0,15,0,0" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/> 
                    </Grid.ColumnDefinitions>
                    <ER:TFUBTWB19X Grid.Column="0" Name="cFERK"
                                  IsKEY="False"
                                  IsCanNew="True"
                                  IsAuto="{Binding IsAuto,ElementName=cFK}"
                                  IsEdit="{Binding IsEdit,ElementName=cFK}"
                                  EXAUF="{Binding KEY,ElementName=cFK}"
                                  CMTR="{Binding CMTR,ElementName=TV}" 
                                  CPCS="{Binding CPCS,ElementName=TV}"    
                                  IsFinish="{Binding IsFQI,ElementName=TV}" 
                                  DFFSCHL="{Binding DFFSCHL,ElementName=cFK}" />
                    <Grid Grid.Column="1" Margin="20,0,0,0">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"></RowDefinition>
                            <RowDefinition Height="1*"></RowDefinition>                           
                            <RowDefinition Height="1*"></RowDefinition>
                        </Grid.RowDefinitions>
                        <SD:YPBOX Grid.Row="0"  YPINFO="{Binding SHIFTPRODUCTION,ElementName=pbYP}"/>
                        <ER:TWB19YP  Grid.Row="1"  Name="pbYP"  Margin="0,10,0,0"
                                  IsEdit="True"
                                  VAR="{Binding VAR,ElementName=pbWB19}" 
                                  DES="{Binding KEY,ElementName=cRK}" 
                                  CMTR="{Binding QTY,ElementName=TV}" 
                                  FWB08KEY="{Binding KEY,ElementName=cFK}"  />
                        <ER:TWB19PTN  Grid.Row="3" Name="pbWB19PT" 
                                  IsEdit="True"
                                  VAR="{Binding VAR,ElementName=pbWB19}" 
                                  DES="{Binding KEY,ElementName=cRK}" 
                                  CMTR="{Binding QTY,ElementName=TV}" 
                                  FWB08KEY="{Binding KEY,ElementName=cFK}"  />
                    </Grid>
                   
                </Grid>
                
            </Grid>
        </TabItem>
        <TabItem Header="当班" Name="cOffline" IsSelected="{Binding IsCOnline,ElementName=TV,Converter={StaticResource not}}" >
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="2*"/>
                    <ColumnDefinition Width="10*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="1*"/>
                </Grid.RowDefinitions>
                <me:TWBQI03
                    IsDBChg="True"
                    Grid.Row="1" 
                      IsFQI="{Binding IsFQI,ElementName=TV}" 
                       MACHINEID="{Binding  MACHINEID,ElementName=TV}" Grid.ColumnSpan="3"   />
            </Grid>

        </TabItem>
        <TabItem Header="{Binding Source={Localization:Translate Word=落布卷}}"  Visibility="Collapsed">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="1*"/>
                </Grid.RowDefinitions>
                <StackPanel  Grid.Row="0">
                    <AB:TSHAB05 
                            ORDERNUM="{Binding ABAUF,ElementName=TV}"  />
                    <WrapPanel >
                        <TextBlock Margin="20,0,0,0"  Grid.Column="0" FontSize="18" VerticalAlignment="Center" 
                             Text="{Binding Source={Localization:Translate Word=当前卷号}}"></TextBlock>
                        <TextBlock Margin="20,0,0,0"  Text="{Binding WBBSTKNR,Converter={StaticResource trim}}" Grid.Column="1" FontSize="18"   Width="80" />
                        <TextBlock  Margin="20,0,0,0"    FontSize="18" VerticalAlignment="Center" Text="{Binding Source={Localization:Translate Word=码表长度:}}"></TextBlock>
                        <ex:NumericBox Margin="20,0,0,0"  Text="{Binding WBBISTKLG,Converter={StaticResource d1000}}" 
                                       FontSize="18"   Width="80" />
                        <TextBlock   Grid.Column="0" FontSize="18" VerticalAlignment="Center" Text="{Binding Source={Localization:Translate Word=已验}}"></TextBlock>
                        <ex:NumericBox Text="{Binding WBBINBSTMTR,Converter={StaticResource d1000}}"
                                       Grid.Column="1" FontSize="18"   Width="80" />
                        <TextBlock   Grid.Column="0" FontSize="18" VerticalAlignment="Center" Text="{Binding Source={Localization:Translate Word=剩余}}"></TextBlock>
                        <ex:NumericBox Text="{Binding QTY,ElementName=TV,Converter={StaticResource d1000}}"
                                       Grid.Column="1" FontSize="18"   Width="80" />
                        <TextBox Text="{Binding WH,ElementName=TV}" Width="100"/>
                        <WH:TSWH KEY="{Binding WH,ElementName=TV}"/>

                    </WrapPanel>
                </StackPanel>
                <FK:TWB18  Grid.Row="1" Name="cRK"
                      EXAUF="{Binding  RWAUF,ElementName=TV}"
                      IsAuto="{Binding IsEdit,ElementName=TV}"
                      IsEdit="True" />
                <ER:TWB19X  Grid.Row="2" Name="pbWB19"  
                       IsFinish="{Binding IsFQI,ElementName=TV}" 
                      EXAUF="{Binding KEY,ElementName=cRK}" 
                      dwNFError="{Binding dwNFError,ElementName=cFERK}"
                      CMTR="{Binding CQTY,ElementName=TV}" 
                      RVEKEY="{Binding RVEKEY,ElementName=cFERK}"/>
            </Grid>

        </TabItem>
        <TabItem Header="{Binding Source={Localization:Translate Word=工艺信息}}"  Visibility="Collapsed">
            <StackPanel>
                <VF:TNOVA10    Visibility="Visible" 
                                 IsNew="True"
                                 KOLL="SHW  "
                                 EXAUF="{Binding WFART,ElementName=TV}"                               
                                 Name="cNOVA"/>
                <WS:TWASTAMM
                        Name="cWS"
                        ORDERNUM="{Binding WAART,ElementName=TV}"
                        dwWS="{Binding dwWS,ElementName=cRZ}"
                        />
            </StackPanel>
        </TabItem>
        <TabItem Header="{Binding Source={Localization:Translate Word=生产单}}" Visibility="Collapsed">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"/>
                    <ColumnDefinition Width="1*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition   Height="Auto" />
                    <RowDefinition   Height="1*" />
                </Grid.RowDefinitions>
                <AB:TAB05RZ    Grid.Row="0" Grid.RowSpan="2" Grid.Column="0"  
                               IsCanLoad="True"
                               POSTYP="VA "
                               MAKE2ORD="False"  
                               Name="cRZ"
                               QTY="{Binding QTY,ElementName=TV}"  
                               EXAUF="{Binding EXORD,ElementName=TV}"
                               IsAuto="True" 
                               />

                <Grid Grid.Row="0" Grid.RowSpan="2" Grid.Column="1"  >
                    <Grid.RowDefinitions>
                        <RowDefinition   Height="Auto" />
                        <RowDefinition   Height="1*" />
                    </Grid.RowDefinitions>
                    <WB:TSHWB04 Name="cWB04" Grid.Row="0" 
                                LOOMID="{Binding LOOMID,ElementName=TV}"
                                EXAUF="{Binding ABAUF,ElementName=cRZ}"
                                dwABP="{Binding dwAB,ElementName=cRZ}"
                                WH="{Binding WH,ElementName=cRZ}"  
                               />
                    <me:TWVWB25  Grid.Row="1"
                                PRTYPE="UBTWVLB"
                                RWAUF="{Binding KEY,ElementName=cWB04}"/>
                </Grid>
            </Grid>

        </TabItem>
        <TabItem Header="{Binding Source={Localization:Translate Word=其他查询条件}}" Visibility="Collapsed">
            <StackPanel>
                <WrapPanel >
                    <Button Content="{Binding Source={Localization:Translate Word=新卷号:}}" 
                        Click="NewWBCommand" FontSize="18" VerticalAlignment="Center"></Button> 
                    <TextBlock   Grid.Column="0" FontSize="18" VerticalAlignment="Center" 
                             Text="{Binding Source={Localization:Translate Word=品种/色号:}}"/>
                    <ex:TXT72 MaxLength="20" Grid.Column="1" FontSize="18"  KeyUp="Query_KeyUp"
                                      Text="{Binding ABAUF,ElementName=TV}" Width="100" />

                    <TextBlock   Grid.Column="0" FontSize="18" VerticalAlignment="Center" 
                             Text="{Binding Source={Localization:Translate Word=织机:}}"/>
                    <ex:TXT72 MaxLength="20" Grid.Column="1" FontSize="18"    
                              KeyUp="Query_KeyUp"
                                      Text="{Binding LOOMID,ElementName=TV}" Width="160" />

                </WrapPanel>
            </StackPanel>
        </TabItem>
    </TabControl>
</me:UIFQI03>
